package com.mitcub.panda.controller;

import com.mitcub.panda.entity.Menu;
import com.mitcub.panda.service.IMenuService;
import com.mitcub.panda.utils.RespResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * @项目名称: panda
 * @类名称: IndexController
 * @类描述:
 * @作者: tangloong
 * @创建时间: 2021/7/21 14:00
 */

@Controller
public class IndexController {

    @Resource
    private IMenuService menuService;

    @GetMapping("/index")
    public String index(){
        return "index";
    }

    @GetMapping("/view/index/console")
    public String console(){
        return "view/index/console";
    }

    @GetMapping("/payment/analysis/index")
    public  String monitor(){return "view/index/monitor";}

    @GetMapping("/view/index/analysis")
    public  String analysis(){return "view/index/analysis";}

    @GetMapping("/view/system/admin/theme")
    public String theme(){
        return "view/system/admin/theme";
    }

    @GetMapping("/view/system/admin/message")
    public String message(){
        return "view/system/admin/message";
    }

    @GetMapping("/view/system/admin/center")
    public String center(){
        return "view/system/admin/center";
    }

    @GetMapping("/view/system/admin/pwd")
    public String pwd(){
        return "view/system/admin/pwd";
    }


    @ResponseBody
    @RequestMapping("/menu")
    public RespResult menu(){
        // 获取菜单
       List<Menu> menuList = menuService.getNavMenu();
       return RespResult.success("success",menuList);
    }

}
